#!/bin/sh

GWNAME=$1
BASEPATH=$2
RESTOREPATH=$3
NEWRESTORE=$4

NEWRESTOREPATH="$BASEPATH/$NEWRESTORE"

function error_exit
{
    echo "$1" 1>&2
    exit 1
}


if [ -d $RESTOREPATH ]; then
	if rm $RESTOREPATH; ln  -s $NEWRESTOREPATH $RESTOREPATH;  then
	   echo "0"

	else
	    exit_error "1"
	fi
	
fi

exit 0

